<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .box{
            display: flex;
            width: 80%;
            margin: 50px auto;
            flex-wrap: wrap;
            justify-content: space-evenly;
        }
        .inner{
            width: 100%;
            height: 60px;
            margin-bottom: 20px;
            background-color: darkgreen;
        }
        .inner:nth-last-child(-n + 2) {
            height: 0;
            margin-bottom: 0;
        }
        @media (min-width: 768px) {
            .inner{
                width: 45%;
            }
        }

        @media (min-width: 922px) {
            .inner{
                width: 30%;
            }
        }

        @media (min-width: 1200px) {
            .inner{
                width: 22%;
            }
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
    </div>
</body>
</html>